package com.sdy.dataexchange.meta.service;

import com.sdy.dataexchange.biz.model.ExDbDict;
import com.sdy.dataexchange.meta.model.MetadataColumn;
import com.sdy.dataexchange.meta.model.MysqlTabColumns;
import com.sdy.dataexchange.meta.model.OracleTabColumns;
import com.sdy.mvc.service.BaseService;

import java.util.List;

/**
 * @author: 王越洋
 * @version: v1.0
 * @description: com.sdy.dataexchange.meta.service
 * @date:2019/10/23
 */
public interface MetadataColumnService extends BaseService<MetadataColumn> {

    /**
     * 查询Mysql表结构
     *
     * @param exDbDict
     * @param table
     * @return
     */
    List<MetadataColumn> queryMysqlTabColumns(ExDbDict exDbDict, String table) throws InstantiationException, IllegalAccessException;

    /**
     * 查询Oracle表结构
     *
     * @param exDbDict
     * @param table
     * @return
     */
    List<MetadataColumn> queryOracleTabColumns(ExDbDict exDbDict, Integer id, String table) throws InstantiationException, IllegalAccessException;

    /**
     * 把查询到的表结构 存放到表中
     *
     * @param metadataColumns
     * @return
     */
    Integer addOracleTabColumns(List<MetadataColumn> metadataColumns);

    Integer addOneTabColumns(MetadataColumn metadataColumn ,Integer modId);

    /**
     * 查询 Oracle 用户中所有表
     *
     * @param exDbDict
     * @return
     */
    List<OracleTabColumns> queryOracleTab(ExDbDict exDbDict);

    /**
     * 查询 Oracle 用户中所有表
     *
     * @param exDbDict
     * @return
     */
    List<OracleTabColumns> queryMysqlTab(ExDbDict exDbDict);

    /**
     * 根据 字段ID 删除字段
     * @param colId
     * @return
     */
    Integer delByColIdColumn(Integer colId);


//    Integer delByIdTabColumns(Integer tabId);

    /**
     * 删除 mod 对应的 表字段
     * @param modId
     * @return
     */
    Integer delAllTabColums(Integer modId);


    List<MetadataColumn> queryByModId(Integer modId);

    Integer updByIdTabColumns(Integer columnId, Integer type, MetadataColumn column);
}
